//
//  LPCostomNinetyLabelAndImageView.m
//  ShangHaiHuDongApp
//
//  Created by 刘应平 on 2017/6/15.
//  Copyright © 2017年 刘应平. All rights reserved.
//

#import "LPCostomNinetyLabelAndImageView.h"

@implementation LPCostomNinetyLabelAndImageView

/**  90  */
- (instancetype)initWithFrame:(CGRect)frame viewCount:(NSInteger)count
{
    self = [super initWithFrame:frame];
    if (self) {
        CGFloat with = [UIScreen zj_screenWith] / count;
        
        
        
        self.homeImageView = [UIImageView new];
        [self addSubview:self.homeImageView];
        self.homeImageView.sd_layout
        .topSpaceToView(self,12 * [UIScreen zj_screenHScale])
        .heightIs(50 * [UIScreen zj_screenHScale])
        .widthIs(50 * [UIScreen zj_screenHScale])
        .leftSpaceToView(self,(with - 50 * [UIScreen zj_screenHScale]) / 2);
        
        
        self.homeLabel = [UILabel new];
        self.homeLabel.textAlignment = NSTextAlignmentCenter;
        
        self.homeLabel.textColor = [UIColor textGrayColor];
        self.homeLabel.font = [UIFont systemFontOfSize:14 * [UIScreen zj_textFontScale]];
        [self addSubview:self.homeLabel];
        self.homeLabel.sd_layout
        .topSpaceToView(self.homeImageView,12 * [UIScreen zj_screenHScale])
        .widthIs(with).heightIs(12 * [UIScreen zj_screenHScale])
        .leftEqualToView(self);
        
        
        self.messageNumber = [UILabel new];
        self.messageNumber.backgroundColor = [UIColor themeColor];
        self.messageNumber.layer.cornerRadius = 12 * [UIScreen zj_screenHScale];
        self.messageNumber.layer.masksToBounds = YES;
        self.messageNumber.textColor = [UIColor whiteColor];
        self.messageNumber.textAlignment = NSTextAlignmentCenter;
        self.messageNumber.font = [UIFont systemFontOfSize:11 * [UIScreen zj_textFontScale]];
        [self addSubview: self.messageNumber ];
        self.messageNumber.sd_layout
        .topSpaceToView(self, 8 * [UIScreen zj_screenHScale])
        .leftSpaceToView(self.homeImageView, -2 * [UIScreen zj_screenWScale])
        .heightIs(24 * [UIScreen zj_screenHScale]).widthIs(24 * [UIScreen zj_screenHScale]);
        self.messageNumber.hidden = YES;
        
    }
    return self;
}

@end
